/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XPF
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface SportsScoreGrade extends BasicModel<SportsScoreGrade> {
  scoreGradeId?: string; // 分值等级主键
  indexId?: string; // 关联单项指标
  singleScore?: string; // 单项指标得分
  scoreGrade?: string; // 得分对应等级
  isDelete?: string; // 删除标记
}

export const sportsScoreGradeList = (params?: SportsScoreGrade | any) =>
  defHttp.get<SportsScoreGrade>({ url: adminPath + '/sports/sportsScoreGrade/list', params });

export const sportsScoreGradeListData = (params?: SportsScoreGrade | any) =>
  defHttp.post<Page<SportsScoreGrade>>({ url: adminPath + '/sports/sportsScoreGrade/listData', params });

export const sportsScoreGradeSelectSingleIndex = (params?: SportsScoreGrade | any) =>
  defHttp.post<Page<SportsScoreGrade>>({ url: adminPath + '/sports/sportsSingleIndex/selectSingleIndex', params });

export const sportsScoreGradeForm = (params?: SportsScoreGrade | any) =>
  defHttp.get<SportsScoreGrade>({ url: adminPath + '/sports/sportsScoreGrade/form', params });

export const sportsScoreGradeSave = (params?: any, data?: SportsScoreGrade | any) =>
  defHttp.postJson<SportsScoreGrade>({
    url: adminPath + '/sports/sportsScoreGrade/save',
    params,
    data,
  });

export const sportsScoreGradeDelete = (params?: SportsScoreGrade | any) =>
  defHttp.get<SportsScoreGrade>({ url: adminPath + '/sports/sportsScoreGrade/delete', params });
export const cancelSingleIndex = (params?: SportsScoreGrade | any) =>
  defHttp.get<SportsScoreGrade>({
    url: adminPath + '/sports/sportsScoreGrade/cancelSingleIndex',
    params,
  });

export const gradeSelectData = (params?: SportsScoreGrade | any) =>
  defHttp.post<Page<SportsScoreGrade>>({
    url: adminPath + '/sports/sportsScoreGrade/selectData',
    params,
  });
